<?php

namespace Application\Model\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Image
 *
 * @ORM\Table(name="image")
 * @ORM\Entity
 */
class Image
{
    /**
     * @var integer
     *
     * @ORM\Column(name="Id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     *
     * @ORM\Column(name="Path", type="string", length=45, nullable=true)
     */
    private $path;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Application\Model\Entity\Project", inversedBy="images")
     * @ORM\JoinTable(name="imageproject",
     *   joinColumns={
     *     @ORM\JoinColumn(name="Images_Id", referencedColumnName="Id")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="Projecs_Id", referencedColumnName="Id")
     *   }
     * )
     */
    private $projecs;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Application\Model\Entity\Task", inversedBy="images")
     * @ORM\JoinTable(name="imagetask",
     *   joinColumns={
     *     @ORM\JoinColumn(name="Images_Id", referencedColumnName="Id")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="Tasks_Id", referencedColumnName="Id")
     *   }
     * )
     */
    private $tasks;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->projecs = new \Doctrine\Common\Collections\ArrayCollection();
        $this->tasks = new \Doctrine\Common\Collections\ArrayCollection();
    }


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set path
     *
     * @param string $path
     * @return Image
     */
    public function setPath($path)
    {
        $this->path = $path;

        return $this;
    }

    /**
     * Get path
     *
     * @return string 
     */
    public function getPath()
    {
        return $this->path;
    }

    /**
     * Add projecs
     *
     * @param \Application\Model\Entity\Project $projecs
     * @return Image
     */
    public function addProjec(\Application\Model\Entity\Project $projecs)
    {
        $this->projecs[] = $projecs;

        return $this;
    }

    /**
     * Remove projecs
     *
     * @param \Application\Model\Entity\Project $projecs
     */
    public function removeProjec(\Application\Model\Entity\Project $projecs)
    {
        $this->projecs->removeElement($projecs);
    }

    /**
     * Get projecs
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getProjecs()
    {
        return $this->projecs;
    }

    /**
     * Add tasks
     *
     * @param \Application\Model\Entity\Task $tasks
     * @return Image
     */
    public function addTask(\Application\Model\Entity\Task $tasks)
    {
        $this->tasks[] = $tasks;

        return $this;
    }

    /**
     * Remove tasks
     *
     * @param \Application\Model\Entity\Task $tasks
     */
    public function removeTask(\Application\Model\Entity\Task $tasks)
    {
        $this->tasks->removeElement($tasks);
    }

    /**
     * Get tasks
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getTasks()
    {
        return $this->tasks;
    }
}
